package personal.domain.accounting;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table (name="account")
@NamedQueries({
	@NamedQuery(name=Account.GET_ALL_ACCOUNTS, query="select acc from Account acc order by lower(acc.accountName) asc")
})
public class Account implements Serializable {
	private static final long serialVersionUID = 1L;
	public static final String GET_ALL_ACCOUNTS = "Account.getAll";
	private Long accountId;
	private Long accountTypeId;
	private String accountName;
	private String color;
	
	@Id
	@GeneratedValue (strategy=GenerationType.AUTO)
	@Column (name="account_id", unique=true, length=11, nullable=false, insertable=true, updatable=false)
	public Long getAccountId() {
		return accountId;
	}
	public void setAccountId(Long accountId) {
		this.accountId = accountId;
	}
	@Column (name="account_type_id", length=11, unique=false, nullable=false, insertable=true, updatable=true)
	public Long getAccountType() {
		return accountTypeId;
	}
	public void setAccountType(Long accountTypeId) {
		this.accountTypeId = accountTypeId;
	}
	@Column (name="account_name", unique=false, length=100, nullable=false, insertable=true, updatable=true)
	public String getAccountName() {
		return accountName;
	}
	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}
	@Column (name="color", unique=false, length=45, nullable=true, insertable=true, updatable=true)
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
}
